package com.yloveg.common;

import java.net.URLDecoder;
import java.net.URLEncoder;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

public class UrlUtil {
	
	public static String toURLEncoded(String paramString) {  
        if (paramString == null || paramString.equals("")) {  
            
            return "";  
        }  
          
        try  
        {  
            String str = new String(paramString.getBytes(), "UTF-8");  
            str = URLEncoder.encode(str, "UTF-8");  
            return str;  
        }  
        catch (Exception localException)  
        {  
            
        }  
          
        return "";  
    }  
    
    public static String toURLDecoded(String paramString) {  
        if (paramString == null || paramString.equals("")) {  
             
            return "";  
        }  
          
        try  
        {  
            String str = new String(paramString.getBytes(), "UTF-8");  
            str = URLDecoder.decode(str, "UTF-8");  
            return str;  
        }  
        catch (Exception localException)  
        {  
           
        }  
          
        return "";  
    }  

}
